package com.coco.group.service;

import com.coco.common.result.ResultData;
import com.coco.group.pojo.TbGroupBuyGoods;
import com.coco.group.pojo.TbGroupBuyRecord;
import com.coco.group.vo.GroupBuyRecordVo;

import java.util.List;

/**
 * @Package: com.coco.group.service
 * @Author: 张dy
 * @Date: Created in 2021/7/29 下午 8:04
 */
public interface GroupBuyRecordService {


    List<TbGroupBuyRecord> findAll();

    ResultData<TbGroupBuyRecord> search(GroupBuyRecordVo groupBuyRecordVo);

    void deleteById(Integer id);

    /**
     * 添加拼团记录
     * @param record
     */
    void addRecord(TbGroupBuyRecord record);


    /**
     * 根据订单查找拼团记录
     * @param tradeNo
     */
    TbGroupBuyRecord findByOrderId(String tradeNo);

    /**
     * 修改参与人数
     */
    void changeJoinNum(Long id);

    /**
     * 拼团完成
     */
    void changeStatusToSuccess(Long id);

    /**
     * 根据邀请码查询单条
     * @param code
     * @return
     */
    TbGroupBuyRecord findByInvitationCode(String code);

}
